Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Okay, this has been talked about, but never really explained...

I know you use it here (test forum)...so the question is...how???

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
In addpost.php find this:

Code
<br />   // ------------------------<br />   // Up their totalposts by 1 <br />      $Totalposts = $user['U_Totalposts'] + 1;<br />      $CurrTitle  = $user['U_Title'];<br />      $Color         = $user['U_Color'];<br />


Change to this - substitute the board's keyword where I have 'test'
Code
<br />   // ------------------------<br />   // Up their totalposts by 1 <br />   		// If it's the test forum then it's navaho uping his post count<br />   		// for his own kicks - then don't increase the post count<br />		if ($Board == 'test') {<br />		      $Totalposts = $user['U_Totalposts'];<br />		      $CurrTitle  = $user['U_Title'];<br />		      $Color         = $user['U_Color'];<br />		}    <br />		  else {<br />		      $Totalposts = $user['U_Totalposts'] + 1;<br />		      $CurrTitle  = $user['U_Title'];<br />		      $Color         = $user['U_Color'];<br />		}    <br /><br />

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Who da man?!! You da man!!!

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
BTW...if you're still around... do I use || to seperate boards if I want posts to not count in several?

Code
($Board == 'UBB1' || $Board == 'UBB2' || $Board == 'UBB3')

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes -
I tend to go nuts with parenthesis - but I think your way will work too.

if (($Board == 'UBB1') || ($Board == 'UBB2') || ($Board == 'UBB3')) {

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Does the script that updates posts counts break this? I was running that script to see if my post count was going up after posting test posts to the boards...and they were. Then I thought, does this script count the number of posts and then update the number? D'oh!

Is this true?

Does this mean I can't use both together?? Or is there a way to edit the post count check script?
Attachments
90109-count.txt (0 Bytes, 47 downloads)

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Probably the post count script counts all the post....


This little number just stops one from getting added each time a new post is made.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Okay, yeah...it looks like it does. It counts the rows...is there a SQL code I could enter to tell it certain values for B_Number, or whatever it is that IDs the board, should be ignored?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
forgot to say - you'd have to edit the Post Count script so that it didn't count posts in those forums

I haven't used it, but I bet there's a "SELECT COUNT(*)" query in it.

Probably need to add something like
AND B_Board != 'UBB1'
AND B_Board != 'UBB2'

etc...

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
...or would I have to tell it which boards it should query individually...and then add up the totals? (the long way!) ahh! hehe.

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
nope...no SELECT COUNT...i attached it in my previous post...i'm looking at it though

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah OK - looks like it selects then just counts the rows.

So this part

$query2 = "SELECT B_Number FROM w3t_Posts WHERE B_PosterId=$Number";


That's where you would add the bit I posted AND B_Board != etc..... for each board you want to exclude. Then it won't grab and count them.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Ahhhh!! I am seeing the light and learning from the wise PetJosh!!! Let me give this a spin.....

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Success!!! sort of.... It is working (not counting posts towards the post count) except for one stingy forum. My off-topic forum at that! LOL...I'm tinkering though. Thanks for all of your help Josh E. Kins!

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Problem is in addpost.php....

You're probably in bed by now, but here's what I have:

Code
	if ( ($Board == 'UBBB62') || ($Board == 'cancer') || ($Board == 'Announcements') || ($Board == 'birthdays') || ($Board == 'UBB55') || ($Board == 'UBB46') ) {


UBB62 is my off-topic board. I had it at the end. I moved it to the beginning just for kicks, but that didn't work either. Oy.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I have even tried this, but it still doesn't work. addpost.php is still adding 1 to my post count for UBB62:

Code
<br />	if ( ($Board == 'cancer') || ($Board == 'Announcements') || ($Board == 'birthdays') || ($Board == 'UBB55') || ($Board == 'UBB46') ) {<br />		$Totalposts = $user['U_Totalposts'];<br />		$CurrTitle = $user['U_Title'];<br />		$Color = $user['U_Color'];<br />	} <br />	elseif ($Board == 'UBBB62') {<br />		$Totalposts = $user['U_Totalposts'];<br />		$CurrTitle = $user['U_Title'];<br />		$Color = $user['U_Color'];<br />	}<br />	  else {<br />		$Totalposts = $user['U_Totalposts'] + 1;<br />		$CurrTitle = $user['U_Title'];<br />		$Color = $user['U_Color'];<br />	}<br />

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]
UBBB62[/]

I think you stutter:
UBB62


Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
LMFAO!!!

Fffff*****k!

*stands in corner*

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Oh, I was just um...seeing if anyone was...um...paying attention! Yea! Good job Joshie! You were!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That is why I am the master and you are the jedi.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
If this was my board (where I'm admin) I would now do this...

<embed src="http://www.drumlines.org/upload/giveself.wav" autostart="true" hidden="true" loop="false" />

Like I have done here: http://www.drumlines.org/threads/showflat.php?Number=43633

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Muhahaha ha

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369



Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Dark side!!! Yay!!!

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
ok, am I missing something completely obvious here? I edited the addposts.php, uploaded (overwrite) and set permissions to 644 (same as the old file).

Nothing happens! Everything works exactly like normal and post count still increases in the selected forum. Is there something special I have to so in order for changes to take effect? The other day I also made a change to the English FAQ file but it don't show up when I click on the FAQ within the forum.

(Yeah, I know, complete newbie question, bear with me please )

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Try deleting the file and then reuploading. For some reason, I've noticed that overwrite doesn't always overwrite. Before you delete it, view the file that is currently on your sever. I bet it is your old copy. If it is the new version, then you might want to contact your host and see if they migrating you do a different server. This can sometimes cause changes not show up until everything is pointing at the new server.

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
thanks. that's what had happened with the FAQ file. (didn't get overwritten correctly)

However, now I have ensured that the addpost file have been uploaded correctly. What happens is that the "title" does not advance but the post-count still does. So obviously I'm doing some wrong. I've added the file I have edited here, could anyone take a look and tell me what's wrong?

thanks
Attachments
108876-addpost.php.zip (0 Bytes, 5 downloads)

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay so you changed it to

[] // ------------------------
// Up their totalposts by 1
// If it's the test forum then it's navaho uping his post count
// for his own kicks - then don't increase the post count
if ($Board == 'hca') {
$Totalposts = $user['U_Totalposts'];
$CurrTitle = $user['U_Title'];
$Color = $user['U_Color'];
}
else {
$Totalposts = $user['U_Totalposts'] + 1;
$CurrTitle = $user['U_Title'];
$Color = $user['U_Color'];
}

[/]

what I would do is go to any IIP pal box or actually anywhere I could insert something that would show and include this command

print_r($user); and then look at the results to make sure it actually lists what you want it to. you may not even have that stuff in your $user array or it may be titled something else..

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
thanks....hmmm...before I can test it though a "IIP pal box" I guess I need to install IIP 5.4.4 first, it's all set up but I need to do a database backup before I complete the install and can't do that myself (need to contact my host)...

hmmm.. this is all more complicated than I thought, seemed to be easy at first

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Off the top of my head, I would say to check the board keyword. Remember, the keywords are case sensative. Otherwise that snippit of code looks good to me.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Magle you can't backup your own database you have to contact your host? onder: Thats strange onder: Anyways you could also try and enter it anywhere else like I don't know a generic threads page?

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
I tried to do a backup and got this:

[]Backup Complete
w3t_AddressBook.sql is 0 bytes or did not get created.w3t_Banned.sql is 0 bytes or did not get created.w3t_Boards.sql is 0 bytes or did not get created.w3t_Cache.sql is 0 bytes or did not get created.w3t_Calendar.sql is 0 bytes or did not get created.w3t_Category.sql is 0 bytes or did not get created.w3t_DisplayNames.sql is 0 bytes or did not get created.w3t_Favorites.sql is 0 bytes or did not get created.w3t_Graemlins.sql is 0 bytes or did not get created.w3t_Groups.sql is 0 bytes or did not get created.w3t_Languages.sql is 0 bytes or did not get created.w3t_Last.sql is 0 bytes or did not get created.w3t_Mailer.sql is 0 bytes or did not get created.w3t_Messages.sql is 0 bytes or did not get created.w3t_ModNotify.sql is 0 bytes or did not get created.w3t_Moderators.sql is 0 bytes or did not get created.w3t_Online.sql is 0 bytes or did not get created.w3t_PollMain.sql is 0 bytes or did not get created.w3t_PollOptions.sql is 0 bytes or did not get created.w3t_PollQuestions.sql is 0 bytes or did not get created.w3t_PollVotes.sql is 0 bytes or did not get created.w3t_Posts.sql is 0 bytes or did not get created.w3t_Queries.sql is 0 bytes or did not get created.w3t_Ratings.sql is 0 bytes or did not get created.w3t_Subscribe.sql is 0 bytes or did not get created.w3t_Users.sql is 0 bytes or did not get created.w3t_Version.sql is 0 bytes or did not get created.

You will need to verify that this command actually backed up the selected tables.[/]

I belive all paths have been set correctly and the backup directory is wrtiable etc....

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
[]scroungr said:
Anyways you could also try and enter it anywhere else like I don't know a generic threads page? [/]

anyway, I'm sorry, but I'm not 100% sure I understand what you mean by that...wouldn't the code automatically not work if taken out of context?
if not, where would I add the additonal code (print_r($user);)?

...guess there's no hiding that I'm not a developer myself, just a lowly user

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I would load up a Generic Threads Page and in the area where you put the code or html you want to use I would put that print_r command. The generic Page can be found in the modifications section here. About your backing up you are trying to backup your files and can't I see where is the directory for backing up? in the admin section of your threads it says it is writable when you click on the check? you could also try and download the phpMyBackup that a few of us use that backs up your whole mysql database not the individual files. This can be ran from your home directory.

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
(slayer> I double checked the "keyword" I'm 100% sure it's correct)

I did test the backup directory, and it passed.

however, poking around a little.

wouldn't this need to be changed too?:
[]
// --------------------------------------
// Now update some stuff in their profile
$query = "
UPDATE {$config['tbprefix']}Users
SET U_Totalposts = U_Totalposts + 1,
U_Laston = '$date',
U_Title = '$UserTitle_q'
WHERE U_Number = '{$user['U_Number']}'
";
$dbh -> do_query($query);
}
[/]

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
[qoute]
// --------------------------------------
// Now update some stuff in their profile
if ($Board == 'hca') {
$query = "
UPDATE {$config['tbprefix']}Users
SET U_Totalposts = U_Totalposts,
U_Laston = '$date',
U_Title = '$UserTitle_q'
WHERE U_Number = '{$user['U_Number']}'
";
$dbh -> do_query($query);
}
}
else {
$query = "
UPDATE {$config['tbprefix']}Users
SET U_Totalposts = U_Totalposts + 1,
U_Laston = '$date',
U_Title = '$UserTitle_q'
WHERE U_Number = '{$user['U_Number']}'
";
$dbh -> do_query($query);
}
}
[/qoute]

I *think* that should be right. This is totally untested, my skillz are...limited, and I haven't applied this myself. But it does look to me like that needs to be changed and this code should be correct.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
my only question is slayer why are you opening it once..
{
and closing it twice?
}
}
??

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
It looked to me like the closing was already there for something else. One closing for the if statement, and one for the closing that was already there. I figured that there was a more elegant way to do it, but I wasn't sure how it should be formatted to account for the existing close.

Would this be better:

// --------------------------------------
// Now update some stuff in their profile
if ($Board == 'hca') {
$query = "
UPDATE {$config['tbprefix']}Users
SET U_Totalposts = U_Totalposts,
U_Laston = '$date',
U_Title = '$UserTitle_q'
WHERE U_Number = '{$user['U_Number']}'
";
$dbh -> do_query($query);
}
else {
$query = "
UPDATE {$config['tbprefix']}Users
SET U_Totalposts = U_Totalposts + 1,
U_Laston = '$date',
U_Title = '$UserTitle_q'
WHERE U_Number = '{$user['U_Number']}'
";
$dbh -> do_query($query);
}
}

Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
Thanks Slayer and scroungr...

hmmmm....Since this mod is implemented on this forum, I wonder if maybe Josh would comment on this matter? is Slayers code right?

(I'm simply too chicken to try this out without some confirmation what could happen... )

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 700
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 19
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)